package pdn.sci.cs.entity;


import java.util.Calendar;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "child_bank")
@GenericGenerator(name = "uuid-strategy", strategy = "uuid.hex")
public class ChildBank extends BaseEntity implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private String id;
	private Child child;
	private String bankName;
	private String accountNumber;
	private String branch;
	private Calendar openedDate;
	private Float openingAmount;
	private Float currentBalance;

	public ChildBank() {
	}

	public ChildBank(String id, Child child, String bankName,
			String accountNumber) {
		this.id = id;
		this.child = child;
		this.bankName = bankName;
		this.accountNumber = accountNumber;
	}

	public ChildBank(String id, Child child, String bankName,
			String accountNumber, String branch, Calendar openedDate,
			Float openingAmount, Float currentBalance, Integer sortOrder,
			String insertUserId, String updateUserId, Date insertDatetime,
			Date updateDatetime) {
		this.id = id;
		this.child = child;
		this.bankName = bankName;
		this.accountNumber = accountNumber;
		this.branch = branch;
		this.openedDate = openedDate;
		this.openingAmount = openingAmount;
		this.currentBalance = currentBalance;
	}

	@Id
	@Column(name = "ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "uuid-strategy")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CHILD_ID", nullable = false)
	public Child getChild() {
		return this.child;
	}

	public void setChild(Child child) {
		this.child = child;
	}

	@Column(name = "BANK_NAME", nullable = false)
	public String getBankName() {
		return this.bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	@Column(name = "ACCOUNT_NUMBER", nullable = false, length = 32)
	public String getAccountNumber() {
		return this.accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	@Column(name = "BRANCH")
	public String getBranch() {
		return this.branch;
	}

	public void setBranch(String branch) {
		this.branch = branch;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "OPENED_DATE")
	public Calendar getOpenedDate() {
		return this.openedDate;
	}

	public void setOpenedDate(Calendar openedDate) {
		this.openedDate = openedDate;
	}

	@Column(name = "OPENING_AMOUNT", precision = 12, scale = 0)
	public Float getOpeningAmount() {
		return this.openingAmount;
	}

	public void setOpeningAmount(Float openingAmount) {
		this.openingAmount = openingAmount;
	}

	@Column(name = "CURRENT_BALANCE", precision = 12, scale = 0)
	public Float getCurrentBalance() {
		return this.currentBalance;
	}

	public void setCurrentBalance(Float currentBalance) {
		this.currentBalance = currentBalance;
	}

}
